package rolesystem.roles.game;

import rolesystem.core.RoleAction;
import rolesystem.roles.KnownEvent;

/**
 * This role is the manager of a generic game.
 * Keywords: game, manager.
 */
public abstract class Manager
{
	/**
	 * Role identifier.
	 */
	public static final String ROLE_ID="game.Manager";


	/**
	 * A player asks the kind of the game.
	 * Sender role: Player
	 */
	public static final KnownEvent KE_askKind=new KnownEvent("askKind", Player.ROLE_ID);

	/**
	 * A player requests to play.
	 * Sender role: Player
	 */
	public static final KnownEvent KE_reqPlay=new KnownEvent("reqPlay", Player.ROLE_ID);

	/**
	 * A player makes a move.
	 * Sender role: Player
	 * Content: Move.
	 */
	public static final KnownEvent KE_Move=new KnownEvent("Move", Player.ROLE_ID, java.io.Serializable.class);

	/**
	 * A player gives up the current game.
	 * Sender role: Player
	 */
	public static final KnownEvent KE_giveUp=new KnownEvent("giveUp", Player.ROLE_ID);


	/**
	 * Notifies the kind of the game.
	 * @param addressee Player
	 * @param content Kind of the game.
	 */
	public static RoleAction notifyKind(int addressee, String content)
	{
		return new RoleAction("notifyKind", addressee, content);
	}

	/**
	 * Notifies to a player that it can play.
	 * @param addressee Player
	 */
	public static RoleAction accept(int addressee)
	{
		return new RoleAction("accept", addressee);
	}

	/**
	 * Notifies to a player that it cannot play.
	 * @param addressee Player
	 */
	public static RoleAction refuse(int addressee)
	{
		return new RoleAction("refuse", addressee);
	}

	/**
	 * Notifies the current situation of the game.
	 * @param addressee Player
	 * @param content Situation of the game.
	 */
	public static RoleAction notifySituation(int addressee, java.io.Serializable content)
	{
		return new RoleAction("notifySituation", addressee, content);
	}

	/**
	 * Requests to a player to make its move.
	 * @param addressee Player
	 */
	public static RoleAction requestMove(int addressee)
	{
		return new RoleAction("requestMove", addressee);
	}

	/**
	 * Refuse the move of a player.
	 * @param addressee Player
	 */
	public static RoleAction refuseMove(int addressee)
	{
		return new RoleAction("refuseMove", addressee);
	}

	/**
	 * Notifies to a player that it has won the game.
	 * @param addressee Player
	 */
	public static RoleAction gameWon(int addressee)
	{
		return new RoleAction("gameWon", addressee);
	}

	/**
	 * Notifies to a player that it has lost the game.
	 * @param addressee Player
	 */
	public static RoleAction gameLost(int addressee)
	{
		return new RoleAction("gameLost", addressee);
	}

	/**
	 * Notifies that the game is over.
	 * @param addressee Player
	 */
	public static RoleAction gameOver(int addressee)
	{
		return new RoleAction("gameOver", addressee);
	}
}
